Skip to content

Clean element identifiers and quote text parameters in several wrappers - #2142

Open
mvdbeek wants to merge 36 commits into
bgruening:masterfrom
mvdbeek:input-handling
Open

mvdbeek wants to merge 36 commits into
bgruening:masterfrom
mvdbeek:input-handling

Conversation

@mvdbeek

@mvdbeek mvdbeek commented Nov 25, 2026 •

Copy link
Copy Markdown
Collaborator

What

Several wrappers put collection element identifiers or text parameters straight into the command line, a sed
replacement, an awk program or a Python configfile. Names with quotes, spaces, $, backticks or similar characters
could break the job or change the command. This PR cleans these values, or passes them as data, and keeps them quoted.
Ordinary names behave as before.

The commits are atomic: each one fixes one thing in one tool directory, and its message says what it fixes. The first
commit for a directory carries the version bump.

The helper

element_identifier_macros.xml (the same file as in tools-iuc) defines @SAFE_ELEMENT_IDENTIFIER@, a Cheetah function
$safe_element_identifier(...): every character other than word characters, - and . becomes _, a leading - or
. becomes _, and an empty name becomes _. It is copied into each tool directory that uses it, imported, and the
token is expanded once at the top of each command/configfile:

@SAFE_ELEMENT_IDENTIFIER@
#set $name = $safe_element_identifier($input.element_identifier)
ln -s '$input' '$name' &&

For several inputs that end up in one directory, the file also has @SAFE_ELEMENT_IDENTIFIERS@, which defines
$safe_element_identifiers(items). It cleans a list of element identifiers (or strings) the same way and adds _2,
_3, ... to a name that is already taken, so identifiers that clean to the same name stay distinct:

@SAFE_ELEMENT_IDENTIFIER@
@SAFE_ELEMENT_IDENTIFIERS@
#for $input, $name in zip($inputs, $safe_element_identifiers($inputs))
    ln -s '$input' '${name}.${input.ext}' &&
#end for

cellprofiler, montage, flexynesis_utils and sylph use it. The copies of the file in diff and sklearn only need the
single-name function and are unchanged.

Tools

Tool Change Version
cp_cellprofiler, cp_cellprofiler4 clean identifiers of the linked input images 3.1.9+galaxy2, 4.2.8+galaxy1
diff clean identifiers used in the HTML report title 3.12+galaxy1
gfastats quote each target sequence, anchor the validator 1.3.11+galaxy3
imagemagick_image_compare, imagemagick_image_montage clean identifiers used as file names and labels, quote them 7.1.2-2+galaxy2 (also re-versions convert)
openbabel_obgrep anchored validator for the SMARTS pattern 3.1.1+galaxy3
tp_replace_in_column pass the find/replace patterns to awk as data (environment / -v) instead of program text 9.11+galaxy1 (shared suffix, all text_processing tools)
keras_train_and_eval, sklearn_model_validation, sklearn_searchcv, sklearn_train_test_eval clean identifiers of the target/reference files; Python literal via json.dumps 1.0.12.1 (shared token, all sklearn tools)
flexynesis, flexynesis_infer, flexynesis_utils clean assay names and identifiers used as file/layer names, quote them; Python literals via json.dumps 1.1.14+galaxy1 (shared suffix)
sylph_profile, sylph_query clean identifiers used as read/genome file names, quote every sketch argument 0.8.1+galaxy2
split_file_to_collection keep base names and column-derived names as plain file names inside the output directory (/, \ and a leading . become _); fixes jobs failing on names like cl1 FASTA (1/2) 0.5.4

Behaviour changes users may notice

  • Names with characters other than letters, digits, _, - and . are cleaned where they become file names, e.g.
    my sample (1).fastq → my_sample__1_.fastq. This shows up in:
    • sylph sample/genome columns and sylph-tax output names;
    • flexynesis layer names (job.feature_logs.<name>) and the split_data collection element names;
    • montage image labels (Mirror Donald → Mirror_Donald);
    • the diff HTML report title;
    • CellProfiler output names derived from input file names.
  • In sylph and flexynesis, a run of spaces now becomes one _ per space (previously one _ for the whole run).
  • When two inputs of a collection give the same cleaned file name, the later ones get _2, _3, ... (cellprofiler, montage
    without indexes, flexynesis_utils split_data, sylph groups, split_file_to_collection by column). Before, cellprofiler dropped
    the image and split_file_to_collection merged the rows; the others failed the job.
  • tp_replace_in_column: / in the find pattern and " in the replacement now work literally. Patterns without them
    behave exactly as before (same regex and backreference semantics).
  • gfastats: the target sequence validator is now anchored. The sanitizer already removed other characters.
  • openbabel_obgrep: a SMARTS pattern with whitespace or quotes, or one starting with -, is now rejected in the form.

Tests

  • planemo lint is clean for every changed tool.
  • planemo test (conda) passes for:
    • cellprofiler (4/4), cellprofiler4 (4/4), diff (6/6), gfastats (16/16), obgrep (2/2);
    • imagemagick compare (5/5) and montage (4/4, including a new test with duplicate names);
    • sylph_profile (12/12) and sylph_query (4/4);
    • tp_replace_in_column (3/3, including a new test with / and " in the patterns);
    • split_file_to_collection (22/22, including new tests with / in the base name and in the id column).
  • Not run:
    • sklearn: the existing tests don't use the changed refseq_and_interval branch, and the environment is very large.
    • flexynesis: container-only requirement.
    • For both, the changed templates were rendered and checked by hand.

The configfile links every input image into ./input under its element
identifier. Identifiers are free text, so a name containing a quote broke
out of the single-quoted ln argument, and a '/' pointed the link into a
directory that does not exist.

Build the link name with $safe_element_identifier (element_identifier_macros.xml,
added to this directory): characters other than word characters, '-' and
'.' become '_'. Ordinary names are unchanged; "my image (1)" now becomes
"my_image__1_", which also shows in the output names derived from it.

Version 3.1.9+galaxy2.
The tar input path was the only unquoted value in the configfile. Dataset
paths are generated by Galaxy, so this is for consistency; no behaviour
change.
Different identifiers can give the same cleaned name ("a b", "a_b", "a(b"
all become "a_b"). The configfile runs its ln lines without '&&', so a
second link with the same name failed silently and that image was left out
of the analysis. The same happened before for identical names.

Add $safe_element_identifiers to element_identifier_macros.xml (token
@SAFE_ELEMENT_IDENTIFIERS@, next to @SAFE_ELEMENT_IDENTIFIER@): it cleans a
list of element identifiers (or strings) and adds _2, _3, ... to a name that
is already taken. The first name keeps its plain form, so inputs without
clashes are unchanged. Use it for the image links.
The configfile links every input image into ./input under its element
identifier. Identifiers are free text, so a name containing a quote broke
out of the single-quoted ln argument, and a '/' pointed the link into a
directory that does not exist.

Build the link name with $safe_element_identifier (element_identifier_macros.xml,
added to this directory): characters other than word characters, '-' and
'.' become '_'. Ordinary names are unchanged; "my image (1)" now becomes
"my_image__1_", which also shows in the output names derived from it.

Version 4.2.8+galaxy1.
The tar input path was the only unquoted value in the configfile. Dataset
paths are generated by Galaxy, so this is for consistency; no behaviour
change.
Different identifiers can give the same cleaned name ("a b", "a_b", "a(b"
all become "a_b"). The configfile runs its ln lines without '&&', so a
second link with the same name failed silently and that image was left out
of the analysis. The same happened before for identical names.

Add $safe_element_identifiers to element_identifier_macros.xml (token
@SAFE_ELEMENT_IDENTIFIERS@, next to @SAFE_ELEMENT_IDENTIFIER@): it cleans a
list of element identifiers (or strings) and adds _2, _3, ... to a name that
is already taken. The first name keeps its plain form, so inputs without
clashes are unchanged. Use it for the image links.
The report title is filled in with sed, and both element identifiers were
written into the single-quoted sed program. A quote ended the sed argument,
and '/', '&' or '\' changed or broke the substitution.

Write the identifiers through $safe_element_identifier
(element_identifier_macros.xml, added to this directory), which leaves only
word characters, '-' and '.'. Ordinary names are unchanged; "my file (1).txt"
appears in the title as "my_file__1_.txt".

Version 3.12+galaxy1.
The target sequence was written unquoted. Its sanitizer keeps '|' and
spaces (needed for headers like "sp|P12345|NAME"), so a '|' was read by the
shell as a pipe instead of being passed to gfastats.

Split the value on whitespace, as the shell did before, and pass each word
single-quoted. Also fix the validator: it was not anchored (Galaxy applies
it with re.match, so only a prefix was checked), and ':-_' was a character
range that also allowed ';<=>?@[\]^'. It now allows exactly what the
sanitizer keeps: ^[0-9A-Za-z:_| -]*$.

Version 1.3.11+galaxy3.
These two dataset paths were the only unquoted file arguments. Galaxy
generates them, so this is for consistency; no behaviour change.
Both inputs were linked as "1.<identifier>.<ext>" / "2.<identifier>.<ext>"
inside double quotes, so a '$', backtick or '"' in an identifier was
expanded by the shell, and a trailing '\' merged it with the next word.

Build both names once with $safe_element_identifier
(element_identifier_macros.xml, added to this directory) and pass them
single-quoted to ln and magick. Ordinary names are unchanged.

The version suffix is shared by the directory, so this also re-versions
imagemagick_image_convert and imagemagick_image_montage to 7.1.2-2+galaxy2.
Same problem as in compare: every input was linked and passed to magick
as "<identifier>.<ext>" (optionally with an index prefix) inside double
quotes, and the input links were not quoted at all.

Use $safe_element_identifier for the names and single-quote them
everywhere. The labels (-label "%t") show the cleaned name, so
"Mirror Donald" is now labelled "Mirror_Donald".
Without index prefixes, two inputs with the same cleaned name (identical
names, or e.g. "Mirror Donald" and "Mirror_Donald") made the second ln fail
and the job stopped.

Add $safe_element_identifiers to element_identifier_macros.xml (token
@SAFE_ELEMENT_IDENTIFIERS@, next to @SAFE_ELEMENT_IDENTIFIER@): it cleans a
list of element identifiers (or strings) and adds _2, _3, ... to a name that
is already taken. The first name keeps its plain form, so inputs without
clashes are unchanged. Use it for the montage inputs; the label then shows e.g.
"Mirror_Donald_2". New test: the same image twice with labels and no
indexes.
The tool turns parameter sanitizing off, because the default sanitizer
would rewrite characters SMARTS needs ('[', ']', '@', '#', ...). The
pattern was therefore written raw into a single-quoted shell argument, so
a quote in it ended the argument.

Add an anchored validator that allows the SMARTS character set without
whitespace or quotes and not starting with '-', so the value can no longer
be read as an obgrep option.

Version 3.1.1+galaxy3.
The dataset path and its extension were unquoted in the call to
multi_obgrep.py. Both come from Galaxy, so this is for consistency; no
behaviour change.
The find pattern was pasted into the awk program as /<pattern>/ and the
replacement as "<replacement>". A '/' in the pattern or a '"' in the
replacement ended that literal: the program broke, or the rest of the
value was run as awk code.

Pass the find pattern through the environment and use it as a dynamic
regex (ENVIRON["FIND_PATTERN_<n>"]); this has the same meaning as /.../.
Pass the replacement with -v, which processes escape sequences exactly like
a "..." literal, so \1 and & keep working. Checked against the old
program on patterns with \., \t, \\, {m,n} and backreferences:
the outputs are identical. New test with '/' and '"' in the patterns.

The version suffix is shared by all text_processing tools, so all of them
move to 9.11+galaxy1.
With the "reference genome and intervals" input, the target file is
bgzipped to "<identifier>.gz" and the genome is copied to "<identifier>",
and both names were passed to bgzip, tabix, cp and the script (partly in
double quotes). A quote, '$' or backtick in an identifier changed the
command.

Build both names once with $safe_element_identifier
(element_identifier_macros.xml, added to this directory), keeping the .gz
suffix, and single-quote them everywhere.

@Version@ is the directory's only version token, so all sklearn tools move
to 1.0.12.1.
Same bgzip/tabix/--targets pattern as keras_train_and_eval: use the cleaned
identifier and keep it single-quoted.
Same bgzip/tabix/--targets pattern as keras_train_and_eval: use the cleaned
identifier and keep it single-quoted.
The Python configfile put the target file's element identifier inside a
'...' string, so a quote in it ended the string and the rest ran as Python.

Write the cleaned name with json.dumps instead, and single-quote the script
path on the command line.
The assay names (main layer, extra omics layers, cox plot omics name) are
text parameters, but the template used their raw value (bypassing the
sanitizer) with only spaces replaced, and wrote them unquoted into file
names, ln and script arguments, and the comma-separated layer lists.

Clean them with $safe_element_identifier (element_identifier_macros.xml,
added to this directory) and single-quote every path and list built from
them. Spaces still become '_' as before, so "b ar" is still "b_ar"; other
characters outside [A-Za-z0-9_.-] now also become '_', including ',', which
used to split a name into two layers.

The version suffix is shared, so flexynesis_infer, flexynesis_utils,
flexynesis_plot and flexynesis_cbioportal_import move to 1.1.14+galaxy1
as well.
Same as in flexynesis: clean the main and extra assay names and quote the
paths built from them.
The X, labels, omics and mutation inputs were linked as
"inputs/<identifier>.<ext>", and the same names went into script arguments
and, inside '...' strings, into the Python configfile. A quote ended the
shell argument or the Python string.

Build each path once from the cleaned identifier, single-quote it in the
command, and write it into the configfile with json.dumps.
The data_column values were pasted into the Python configfile as
"$param-2". Write them as int(...) so the configfile only ever contains a
number there. No behaviour change.
Two omics inputs with the same cleaned name made the second ln fail and the
job stopped.

Add $safe_element_identifiers to element_identifier_macros.xml (token
@SAFE_ELEMENT_IDENTIFIERS@, next to @SAFE_ELEMENT_IDENTIFIER@): it cleans a
list of element identifiers (or strings) and adds _2, _3, ... to a name that
is already taken. The first name keeps its plain form, so inputs without
clashes are unchanged. Use it for the omics files.
Reads and genomes are linked under their element identifier, with only
whitespace replaced, and the names were passed to sylph sketch unquoted
(group inputs as one space-separated string). Any shell character in an
identifier was run by the shell.

Build the names with $safe_element_identifier (element_identifier_macros.xml,
added to this directory), collect group inputs in a list and single-quote
every name. sylph writes these names into its output, so "my sample (1)"
now appears as "my_sample__1_.fastq", and a run of spaces gives one '_' per
space instead of one in total.

Version 0.8.1+galaxy2 for both tools.
Two reads or genomes in a group with the same cleaned name made the second
ln fail and the job stopped.

Add $safe_element_identifiers to element_identifier_macros.xml (token
@SAFE_ELEMENT_IDENTIFIERS@, next to @SAFE_ELEMENT_IDENTIFIER@): it cleans a
list of element identifiers (or strings) and adds _2, _3, ... to a name that
is already taken. The first name keeps its plain form, so inputs without
clashes are unchanged. Use it on the identifiers without their .fastq(.gz) or .fasta(.gz)
extension and add the extension back afterwards, so sylph still recognises
the format.
…rectory

Output paths were built as os.path.join(out_dir, name) without checking the
name. The base name of a record split keeps '/' through Galaxy's sanitizer,
and in a column split the name comes from the dataset itself. So:

- a base name like "cl1 FASTA (1/2)" failed with FileNotFoundError,
  because "cl1 FASTA (1" is not a directory;
- a base name or a column value with "../" or a leading "/" created or
  appended to files outside the output directory.

Replace '/', '\' and NUL with '_', and a leading '.' as well, in both the
base name and the column-derived names. Names without these characters are
unchanged. New test with base name "../cl1 (1/2)".

Version 0.5.4.
…cide

After cleaning, column values such as "a/b" and "a_b" map to the same file
name, so their rows would be merged into one output. Give each distinct
name its own file: later names that are already taken get _2, _3, ...
before the extension. New test with "a/b", "a_b" and "/tmp/x" ids.
The ob_grep change gives the repository a new revision, and the shed
linter requires every tool in it to have a version above the latest
installable one. Bump the Galaxy suffix of each other tool by one.
A test with expect_failure="true" may not declare outputs, and the
linter rejects it (TestsOutputFailing). The output was never compared
because the job is expected to fail.
convert.xml hardcodes its suffix instead of using @VERSION_SUFFIX@, so
the macro bump did not reach it and the shed linter reports a version
equal to the latest installable revision.
The cellprofiler tool change gives the repository a new revision, and
the shed linter requires every tool in it to have a version above the
latest installable one. Bump the Galaxy suffix of each other tool by
one.
display_data_on_image offered PathName twice in the measurement
category select, with two matching when blocks, so the tool defined
the same parameter name twice. Remove the second option and its when
block; the choices the user sees are otherwise unchanged.
export_to_spreadsheet (output_file_location), save_images
(subfolder_in_output) and the Split tests of color_to_gray
(name_output_image) set values for inputs the tools do not have. The
templates write fixed values for these settings, so the parameters
were ignored and the expected pipelines do not change.
The tests of tile, starting_modules, image_math and
measure_image_quality set parameters at the top level that the tools
define inside a section or conditional. Legacy test handling matched
them by name; nesting them as the inputs are declared lets the tests
validate on current tool profiles. The tested values are unchanged.
remote_repository_url named the parent tools/ directory for both
cellprofiler repositories. Point it at tools/cellprofiler and
tools/cellprofiler_v4, and add the homepage_url and long_description
that cellprofiler was missing, taken from cellprofiler_v4.
@bgruening bgruening added the tool-bot:review ask gxy-tool-bot to review a pr label Nov 27, 2026
@bgruening
bgruening deployed to fork-review November 27, 2026 21:44 — with GitHub Actions Active
@github-actions github-actions Bot removed the tool-bot:review ask gxy-tool-bot to review a pr label Nov 27, 2026
@github-actions

Copy link
Copy Markdown
Contributor

Tool Review: tools/cellprofiler/

Summary: 🔴 11 critical · 🟡 8 warning(s) · 🔵 1 suggestion(s)


🔴 Critical

[security_bugs] cellprofiler.xml:24

In the <command> template, #if '$detailed_output' quotes the Cheetah variable inside the conditional expression. Because the literal string 'false' is non-empty, #if '$detailed_output' always evaluates to true even when detailed_output is False, causing -L 10 > ./cp.log 2>&1 to always execute and redirect stdout/stderr away from Galaxy.

Suggestion: Change #if '$detailed_output' to #if $detailed_output:.

[security_bugs] enhance_or_suppress_features.xml:92

Several bugs in the inline Python script will crash or produce malformed .cppipe output depending on selected options:

  • Line 92: con_feature_type = params['con_enhance_suppress']['con_feature_type'] is evaluated unconditionally before checking operation, raising KeyError when select_operation is "Suppress".
  • Lines 98–104: The "Suppress" branch omits \n at the end of 7 parameter lines (Feature type through Speed and accuracy), concatenating them onto a single line.
  • Line 134: The "Line structures" branch writes Decay:0.9\n5 (no trailing newline and a stray newline inside 0.95).
  • Line 156: The "Texture" branch reads con_feature_type['circle_feature_size'] (KeyError, since "Texture" only defines texture_smoothing_scale).
  • Line 168: The "DIC" branch reads con_feature_type['texture_smoothing_scale'] (KeyError, since "DIC" defines dic_smoothing_scale).

Suggestion: Move con_feature_type lookup inside elif operation == "Enhance":, add \n to all lines in the "Suppress" and "Line structures" branches, fix Decay:0.95\n, and read 10 (or the appropriate parameter) for "Texture" and dic_smoothing_scale for "DIC".

[security_bugs] gray_to_color.xml:79

Multiple parameter-lookup and loop bugs break all color_scheme modes other than RGB:

  • Lines 79, 82, 85: rgb_blue_weight, rgb_green_weight, and rgb_red_weight are indexed directly on params['con_color_scheme'] without checking key existence, raising KeyError when color_scheme is CMYK, Stack, or Composite.
  • Line 21 & 105: The cmyk macro defines name="rgb_green_weight" (Relative weight for the green image) instead of cmyk_magenta_weight, and line 105 reads cmyk_cyan_weight instead of cmyk_magenta_weight.
  • Lines 153–169: Iterates for i in params['con_color_scheme']['rpt_image_name']: but indexes the list itself by string key (params['con_color_scheme']['rpt_image_name']['image_name'], raising TypeError), and emits only one Image name/Color/Weight block outside the loop.

Suggestion: Guard rgb_*_weight lookups with in params['con_color_scheme'] (or .get()), rename rgb_green_weight in the cmyk macro to cmyk_magenta_weight and read cmyk_magenta_weight on line 105, and index i[...] while appending each channel block inside the rpt_image_name loop.

[security_bugs] display_data_on_image.xml:128

Line 128 unconditionally accesses obj_img_params['con_obj_measurement_category']['measurement']. When display_obj_image is "Object" and measurement_category is "Location", the <when value="Location"> block (line 21) defines name="obj_measurement", so line 128 raises KeyError: 'measurement'. Additionally, image_thresh_objects (line 80) is never read or appended when measurement_category == "Threshold".

Suggestion: Rename obj_measurement to measurement (or read obj_measurement for Location), and handle image_thresh_objects for Threshold if needed by CellProfiler.

[security_bugs] measure_image_quality.xml:136

The threshold counting and iteration logic in writemiq() is inverted and raises KeyError in multiple branches:

  • When calc_threshold == "No", line 138 sets all_method = "No", and line 170 (if all_method == "No":) attempts to iterate params['con_calc_threshold']['con_use_all_methods']['rpt_threshold_method'], raising KeyError: 'con_use_all_methods'.
  • When calc_threshold == "Yes" and use_all_methods == "Yes", line 144 accesses rpt_threshold_method, which only exists in the "No" branch (KeyError).
  • When calc_threshold == "Yes" and use_all_methods == "No", line 142 hardcodes threshold_count = 1 instead of len(rpt_threshold_method).

Suggestion: Only compute len(rpt_threshold_method) and enter the loop at line 170 when calc_threshold == "Yes" and all_method == "No", and set threshold_count = 1 otherwise (emitting default placeholder threshold lines when calc_threshold == "No" or all_method == "Yes").

[security_bugs] measure_texture.xml:44

Line 44 unconditionally computes obj_count = len(params['con_img_obj']['rpt_obj_to_measure']). When img_obj is "Images", rpt_obj_to_measure is not in the conditional, raising KeyError: 'rpt_obj_to_measure'.

Suggestion: Set obj_count = 1 (or 0 as expected by CellProfiler) when img_obj == "Images", and only read len(params['con_img_obj']['rpt_obj_to_measure']) when img_obj != "Images".

[security_bugs] save_images.xml:107

Line 107 unconditionally reads params['con_type_of_image']['con_save_file_format']['file_format'], which only exists when type_of_image == "Image". Selecting Mask, Cropping (which expand file_format directly under con_type_of_image at lines 173 and 176), or Movie (which only defines bit_depth at line 179) will raise KeyError: 'con_save_file_format'.

Suggestion: Handle each type_of_image branch explicitly when reading file_format and bit_depth (and default file_format to tiff for Movie).

[security_bugs] image_math.py:39

image_math.py mishandles unary and logical operations from image_math.xml:

  • For invert, log_2, and log_legacy, image_math.xml (lines 185–205) puts select_the_image and multiply_the_image_by directly under operation, not under operation.first_image, so build_first_image_block() writes empty values for Image or measurement?:, Select the first image:, and Multiply the first image by:.
  • For and, or, not, and equals, op_results does not exist (and for not, second_image does not exist), yet build_main_block() and build_variable_block() emit empty values (e.g. Raise the power of the result by:, Set values less than 0 equal to 0?: as seen in test-data/image_math_3.cppipe:105-120), which CellProfiler cannot parse as valid floats/booleans.

Suggestion: Read operation.select_the_image and operation.multiply_the_image_by for invert/log_2/log_legacy, and populate valid CellProfiler defaults (1.0, 0.0, No, None, Image) whenever op_results, multipliers, or second_image are absent.

[security_bugs] identify_primary_objects.xml:306

Two bugs affect parameter output in write_ipo():

  • Line 306: Assigns to assing_pixel (typo) instead of assign_pixel when threshold_strategy == "Adaptive" and threshold_class == "Three classes", so selecting "Background" silently writes "Foreground".
  • Line 356: "Manual threshold:%d\n" % manual_threshold formats a float in [0.0, 1.0] using %d, truncating fractional thresholds (e.g. 0.5) to 0.

Suggestion: Fix assing_pixel to assign_pixel on line 306 and format manual_threshold with %.4f (or %g) on line 356.

[validation] convert_objects_to_image.xml:76

Option "unit16" (lines 76 and 81) is a typo for "uint16", which CellProfiler will reject. Additionally, lines 109–119 misspell six matplotlib colormaps using uppercase I instead of lowercase l (RdYIBu, RdYiGn, YIGn, YIGnBu, YIOrBr, YIOrRd instead of RdYlBu, RdYlGn, YlGn, YlGnBu, YlOrBr, YlOrRd).

Suggestion: Change unit16 to uint16 and correct the Yl* / RdYl* colormap names.

[validation] measure_image_quality.xml:219

calc_for_images applies <expand macro="text_validator" /> (^[A-Za-z0-9 _-]*$), which forbids commas, directly contradicting the help text ("Image names are separated by comma...") and preventing users from specifying multiple image names.

Suggestion: Allow commas in the validator for calc_for_images (e.g. ^[A-Za-z0-9 _,-]*$).

🟡 Warning

[brittleness] cellprofiler.xml:44

find \pwd`/input -name "." > list.txtinscript_fileskips files without a.in their filename (possible inside tar archives) and will include directories if a directory name contains a.. Also, for non-tar inputs, ln -s '$filename' './input/${name}.${filename.ext}'appends.exteven ifelement_identifieralready includes the extension (producing names like...d0.tif.tifand...d0.tif_Overlay`).

Suggestion: Use find "$(pwd)/input" \( -type f -o -type l \) > list.txt.

[brittleness] identify_primary_objects.xml:47

size_smoothing_filter has min="0" max="1", restricting manual smoothing filter sizes to 0 or 1 even though CellProfiler permits larger integer filter sizes (e.g., the test expectation uses 10 when auto-calculated).

Suggestion: Remove max="1" on size_smoothing_filter.

[brittleness] display_data_on_image.xml:241

min_color_map_range has min="0.0" and max_color_map_range has max="1.0", preventing manual color map ranges for any measurement outside [0, 1] (such as pixel intensities, object areas, or object numbers).

Suggestion: Remove the min="0.0" and max="1.0" bounds on min_color_map_range and max_color_map_range.

[brittleness] measure_granularity.xml:56

Line 56 writes "Select objects to meausre:%s\n" (typo meausre instead of measure).

Suggestion: Fix the spelling to Select objects to measure:%s\n.

[conventions] color_to_gray.xml:138

<command detect_errors="exit_code"> is used instead of detect_errors="aggressive".

Suggestion: Change to detect_errors="aggressive".

[conventions] cellprofiler.xml:1

Across all 24 tool XMLs in tools/cellprofiler/:

  • No tool specifies a profile attribute (causing planemo ToolProfileLegacy 16.01 warnings).
  • No tool defines <version_command>.
  • <help> sections use reStructuredText (and HTML tags such as <i> in color_to_gray.xml:156-157 and <br> in parameter <help> blocks like save_images.xml:11-15) rather than <help format="markdown">.
  • <test> elements in all module wrapper tools omit expect_num_outputs="1".

Suggestion: Update tools to set profile (e.g. 24.1), add <version_command>, migrate <help> to format="markdown" without HTML tags, and add expect_num_outputs="1" to <test> elements.

[test_coverage] display_data_on_image.xml:271

Most module wrapper tools (convert_objects_to_image.xml, display_data_on_image.xml, enhance_or_suppress_features.xml, gray_to_color.xml, mask_image.xml, measure_granularity.xml, measure_image_area_occupied.xml, measure_image_intensity.xml, measure_image_quality.xml, measure_object_intensity.xml, measure_object_size_shape.xml, measure_texture.xml, relate_objects.xml, save_images.xml) have only a single <test> case, leaving major <conditional> branches untested (which masked the runtime KeyError/TypeError bugs noted above).

Suggestion: Add test cases covering each major <conditional> branch in these tools (e.g. Location/Color in display_data_on_image, Suppress/Texture/DIC in enhance_or_suppress_features, CMYK/Stack/Composite in gray_to_color, calc_threshold branches in measure_image_quality, Images in measure_texture, Mask/Movie in save_images, and invert/log_2 in image_math).

[completeness] starting_modules_image.xml:1

There are unused/empty leftover files in the repository: starting_modules_image.xml (0 bytes; starting_modules_images.xml is the active file), test-data/image_math.xml (0 bytes), and test-data/tile_across_cyles.cppipe (typo duplicate of test-data/tile_across_cycles.cppipe). Also .shed.yml:12 contains the typo moudule in description_template.

Suggestion: Remove the unused/empty files (starting_modules_image.xml, test-data/image_math.xml, test-data/tile_across_cyles.cppipe) and fix moudule to module in .shed.yml.

🔵 Suggestion

[conventions] macros.xml:34

input_pipeline_param uses format="data" while output_pipeline_param outputs format="txt" (output.cppipe).

Suggestion: Use format="txt" on input_pipeline_param to match the produced pipeline datatype.

This branch was successfully deployed

1 active deployment
fork-review — 515b61c4 Deployed Nov 27, 2026 by bgruening via Review fork PR #31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants